<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>get_marked</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="../css/marked_css.css" />
		<link rel="stylesheet" href="../css/obsidian-theme.css">
		
		<script src="../javaScript/vue.js"></script>
		<script src="../javaScript/jquery-3.4.1.js"></script>
		<script src="../javaScript/marked.min.js"></script>
		<script src="../javaScript/prettify.js"></script>
		<script src="../javaScript/clipboard.min.js"></script>
		<script src="../javaScript/cp.js"></script>
	</head>

	<body class="stackedit">
		<div id="app">
			<div class="stackedit__html">
				<div v-html="md"></div>
			</div>
		</div>
		<script type="text/javascript">
			new Vue({
				el: '#app',
				data() {
					return {
						md: null,
					}
				},
				// 生命周期钩子-挂载后执行
				mounted() {
					var that = this;
					$(function(){
						$.ajax({
							type:"get",
							url:"../../框架使用说明文档.md",
							dataType:"html",
							async: false,
							success:function(res){
								// console.log(res)
								// that.md = marked.parse(res);
								var reg = new RegExp("<pre","g");
								var content = that.md = marked.parse(res);
								var str = content.replace(reg, "<pre class='prettyprint linenums'");
								that.md = str
								// console.log(123)
								// document.getElementById('md').innerHTML = that.md
								$(function(){
									var copy_text_array = [];
									var pres = $("pre");
									if (pres.length) {
										pres.each(function() {
											var that = this;
											var copy_text = $(that).find("code").text();
											copy_text_array.push(copy_text)
										})
									}
									prettyPrint();
									$.fn.copy_init(copy_text_array);
								})
							}
						})
					});
				},
				methods:{}
			})
		</script>
	</body>
</html>